﻿using MediatR;
using SmartFarmSleep.Common.Domain;
using SmartFarmSleep.Common.Infrastrue;

namespace SmartFarmSleep.Organ.API.Commands.SheepFarmCommands
{
    public class SheepFarmCreatHandler
    {
        //private readonly IBaseRepository<SheepFarm> sheepfarmRep;


        //public SheepFarmCreatHandler(IBaseRepository<SheepFarm> sheepfarmRep)
        //{
        //    this.sheepfarmRep = sheepfarmRep;
        //}

        //public async Task<Result> Handle(SheepFarmCreateCommand request, CancellationToken cancellationToken)
        //{
        //    var query = new Result() { Code = 0 };

        //    var list = new SheepFarm()
        //    {
        //        FarmId = request.AddSheepFarm.FarmId,
        //        SerialId = request.AddSheepFarm.SerialId,
        //        SheepFarmNo = request.AddSheepFarm.FarmName,
        //        FarmName = request.AddSheepFarm.FarmName,
        //        BuildingDate = request.AddSheepFarm.BuildingDate = DateTime.Now,
        //        FarmAddress = request.AddSheepFarm.FarmAddress,
        //        FarmState = request.AddSheepFarm.FarmState,
        //        CreateName = request.AddSheepFarm.CreateName = "zhangsan",
        //        CreateDate = request.AddSheepFarm.CreateDate = DateTime.Now,
        //        UpdateName = request.AddSheepFarm.UpdateName = "zhangsan",
        //        UpdateDate = request.AddSheepFarm.UpdateDate = DateTime.Now,
        //        IsDelete = request.AddSheepFarm.IsDelete = false,
        //        HeadID = request.AddSheepFarm.HeadID,
        //        ManagementID = request.AddSheepFarm.ManagementID,
        //        ProvinceId = request.AddSheepFarm.ProvinceId,
        //        CityId = request.AddSheepFarm.CityId,
        //        CountyId = request.AddSheepFarm.CountyId
        //    };

        //    if (list != null)
        //    {
        //        var result = sheepfarmRep.Add(list);
        //        query.Code = 1;
        //    }

        //    return query;
        //}
    }
}
